 package net.stratusprogramming.school.Game.Framework.Items;

import net.stratusprogramming.school.Game.Framework.Battle.Combatant;

/**
 * 
 * @author Dominic Vitello, Patrick Lienau, Jeremy Pan
 * @since 5/9/12
 * @version 0.1
 */
public class Spell extends Weapon	{
	
	/**
	 * Cost in mana of the spell
	 */
	protected float cost;
	
	
	/**
	 * Creates a empty spell
	 */
	public Spell() {
		
	}
	
	/**
	 * Creates a new spell
	 * 
	 * @param name the name of the spell
	 * @param value the value selling the spell
	 * @param effect the effect that the spell will have on the combatant
	 * @param cost how much the spell will cost mp
	 */
	public Spell(String name, float value, Effect effect, float cost)	{
		super(name, value, 0, effect);
		this.cost = cost;		
	}

	@Override
	public String attack(Combatant enemy, Combatant owner) {
		if(owner.getMana() < cost) return "";
		owner.setMana(owner.getMana()-cost);
		return super.attack(enemy, owner);
	}
	
	

}
